<%@ page contentType="text/html;charset=utf-8"%>
<%@ page
	import="java.io.*, java.sql.*, java.util.*, java.text.*, napal.*, util.*, napal.*"%>
<%@ page import="org.apache.ibatis.*"%>
<%@ page import="java.util.Date"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("utf-8");
	Date date = new Date();
%><%
	String userID =  (String)session.getAttribute("userID");
	String managerID =  (String)session.getAttribute("managerID");
	String userRank = (String)session.getAttribute("userRank");
	String managerRank = (String)session.getAttribute("managerRank");
%>
 <script language="javascript">
 function setClock(i)
 {
         var time_value = 1369328166 * 1000 + i;
         var now = new Date();
         now.setTime(time_value);

         var Months  = now.getMonth() + 1;
         var Day     = now.getDate();
        var Hours   = now.getHours();
         var Minutes = now.getMinutes();
         var Seconds = now.getSeconds();

        var Value = " " + Months + "/" + Day + "  ";

        Value += ((Hours>12)? Hours - 12 : Hours);
        Value += ((Minutes <10) ? ":0" : ":") + Minutes;
        Value += ((Seconds <10) ? ":0" : ":") + Seconds;
        Value += (Hours >=12) ? " pm" : " am";
        document.clockForm.clock.value = Value;

        i = i + 1000;
        setTimeout ("setClock("+i+")", 1000);
}
</script>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>성공회대학교 기자재대여시스템</title>
<!-- Bootstrap -->
<script src="./bootstrap/js/bootstrap.js"></script>
<link href="./bootstrap/css/bootstrap.css" rel="stylesheet"
	media="screen">
<style type="text/css">
* {
	padding: 0px;
	margin: 0px;
} /* 브라우저별 기본 여백 차이가 있기에 작성한다. */
body {
	font-size: 9pt;
}

td {
	font-size: 9pt;
}
	.selectableItem:hover{ background-color:gray;
cursor:pointer}
</style>

</head>
<body style="background:#FFFFFF url(../img/back.jpg) no-repeat fixed right bottom">
	<TABLE WIDTH="100%" HEIGHT="300">
		<TR HEIGHT="100">
			<td>
<div class="row-fluid">
	<div class="span12">
		<a class="btn btn-link btn-small"
			onclick="{window.external.AddFavorite('http://www.skhu.ac.kr', '기자재대여시스템')}">즐겨찾기</a>
		l <a class="btn btn-link btn-small"
			onclick="this.style.behavior='this.href'; this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.skhu.ac.kr/');"
			title="기자재대여시스템을 등록"> 시작페이지등록</a>

		<div class="row-fluid">
		<div>
			<div class="span4" style="float: left;"></div>
			<div class="span4" style="float: right;">
				<%

								String s = request.getParameter("id");
								User user = RentalHome.getUser(s);
								Manager manager = RentalHome.getManager(s);
								

									if ((String)session.getAttribute("managerID")!=null) {
				%>
				· <%=(String)session.getAttribute("managerID")%><br>
				· <%=(String)session.getAttribute("managerRank")%><br> 
				<form name="clockForm" style="margin:0; padding:0;">
 				 <INPUT TYPE="text" NAME="clock" id="txtClock" VALUE=" " SIZE="18" ALIGN="RIGHT" readonly>
 				 <script>setClock(0)</script>
				</form>
				<br>
				<%
					}
							else if((String)session.getAttribute("userID")!=null){
				%>
				· 
				<%=(String)session.getAttribute("userID")%><br>
				· 
				<%=(String)session.getAttribute("userName")%><br>
				· 
				<%=(String)session.getAttribute("userRank")%>(<%=(String)session.getAttribute("userDepart")%>)<br>
				<form name="clockForm" style="margin:0; padding:0;">
 				 <INPUT TYPE="text" NAME="clock" id="txtClock" VALUE=" " SIZE="18" ALIGN="RIGHT" readonly>
 				 <script>setClock(0)</script>
				</form><br>
				<%
					}				
				%>
				<%
					if((String)session.getAttribute("userID")!=null){
				%>
				<form name="InfoChange" action="./InfoChange.jsp?id=<%=(String)session.getAttribute("userID")%>"
					method="POST">
					<input class="btn btn-link btn-small" type="submit" value="정보변경"
						name="submit" />l<a href="./Logout.jsp" class="btn btn-link btn-small">로그아웃</a><br>
					<%
						}
					else if((String)session.getAttribute("managerID")!=null){
					      int count=0;
					      for(RentalWait p : RentalHome.RentalWaitExist2()){
					       count++;
					      }%>
					      <a href="./Logout.jsp" class="btn btn-link btn-small">로그아웃</a><br>
					      <p class="text-error">[승인대기중 <%=count %>건]</p>
					      <%}%><br>
				</form>
			</div>
						<div class="span4" >
				<c:url value="../img/logo.jpg" var="p" />
				<%-- 					<a href="${ p }">test5</a> <br/>  --%>

				<img src="${ p }" style="width: 250px; height: 100px;">
			</div>
		</div>
	</div>
</div>
</div>
</div>
</td>
</TR>
<TR HEIGHT="50">
	<td>
		<%
			if ((String)session.getAttribute("managerID")!=null) {
		%> <%@ include file="./ManagerMenu.jsp"%> <%
 	}
  		else if((String)session.getAttribute("userID")!=null){
 %> <%@ include file="./UserMenu.jsp"%> <%
 	}

  		else{}
 %>